// 简单的封装了下请求
const postHttps = async (type = 'POST', url, data) => {
  let responseResult = await $.ajax({
    type,
    data: JSON.stringify(data),
    url: `https://www.hiruo.cn/macula-plugins-webapp/mobile/${url}`,
    headers: {
      "Content-Type": "application/json",
    },
    timeout: 60000,
    dataType: 'json'
  });
  return responseResult;
}
// 文件上传
const fileUpLoad = async (url, file) => {
  let data = new FormData();
  data.append('file', document.getElementById(file).files[0]);
  let responseResult = await $.ajax({
    type: 'POST',
    url: `https://www.hiruo.cn/macula-plugins-webapp/mobile/${url}`,
    // 好像不写这个也行,不管了
    "Content-Type": "multipart/form-data",
    data,
    timeout: 60000,
    cache: false,
    processData: false, 
    contentType: false,
  });
  return responseResult;
}
// 该死的，以为要export
// export default { postHttps }